package com.xu.wemall.commons.utils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;

public class FileUtils {

    public static List<String> getLines(String filePath){
        try {
            return Files.lines(Paths.get(filePath)).collect(Collectors.toList());
        } catch (
                IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static void main(String[] args) {
        List<String> line1 = getLines("D:\\lines.txt");
        //linesList.forEach(System.out::println);

        List<String> line2 = getLines("D:\\lines2.txt");
        line1.removeAll(line2);
        line1.forEach(System.out::println);

    }

}
